﻿using CoreLibrary.Objects;
using CoreLibrary.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoreLibrary.People
{
    public class PeopleTemp
    {
        public List<Person> people = new List<Person>();
        public PeopleTemp()
        {
            var dude1 = new Person() { Name = "Jim Bob", Height = PersonHeight.Short, Sex = PersonSex.Male, HairColor = PersonHairColor.Blonde, Build = PersonBuild.Athletic };
            var dude2 = new Person() { Name = "Tim Thompson", Height = PersonHeight.Tall, Sex = PersonSex.Male, HairColor = PersonHairColor.Brown, Build = PersonBuild.Strong };
            var dude3 = new Person() { Name = "Jack Smith", Height = PersonHeight.Medium, Sex = PersonSex.Male, HairColor = PersonHairColor.Black, Build = PersonBuild.Thin };

            var chick1 = new Person() { Name = "Plain Jane", Height = PersonHeight.Medium, Sex = PersonSex.Female, HairColor = PersonHairColor.Red, Build = PersonBuild.Athletic };

            GenerateRandomLikes(dude1);
            GenerateRandomLikes(dude2);
            GenerateRandomLikes(dude3);
            GenerateRandomLikes(chick1);

            people.Add(dude1);
            people.Add(dude2);
            people.Add(dude3);
            people.Add(chick1);
        }


        public void GenerateRandomLikes(Person p)
        {
            foreach (var item in Enum.GetValues(typeof(PersonSex)).Cast<PersonSex>().ToList())
            {
                p.LikeNotLike.AddProperty(Chance.SelectRandomValue(Enum.GetValues(typeof(TierLevel)).Cast<TierLevel>().ToList()), typeof(Person), PropertyHelper<PersonSex>.GetPropertyName(() => p.Sex), item);
            }
            foreach (var item in Enum.GetValues(typeof(PersonHeight)).Cast<PersonHeight>().ToList())
            {
                p.LikeNotLike.AddProperty(Chance.SelectRandomValue(Enum.GetValues(typeof(TierLevel)).Cast<TierLevel>().ToList()), typeof(Person), PropertyHelper<PersonHeight>.GetPropertyName(() => p.Height), item);
            }
            foreach (var item in Enum.GetValues(typeof(PersonHairColor)).Cast<PersonHairColor>().ToList())
            {
                p.LikeNotLike.AddProperty(Chance.SelectRandomValue(Enum.GetValues(typeof(TierLevel)).Cast<TierLevel>().ToList()), typeof(Person), PropertyHelper<PersonHairColor>.GetPropertyName(() => p.HairColor), item);
            }
            foreach (var item in Enum.GetValues(typeof(PersonBuild)).Cast<PersonBuild>().ToList())
            {
                p.LikeNotLike.AddProperty(Chance.SelectRandomValue(Enum.GetValues(typeof(TierLevel)).Cast<TierLevel>().ToList()), typeof(Person), PropertyHelper<PersonBuild>.GetPropertyName(() => p.Build), item);
            }

            Item i = new Item();
            foreach (var item in Enum.GetValues(typeof(ItemColor)).Cast<ItemColor>().ToList())
            {
                p.LikeNotLike.AddProperty(Chance.SelectRandomValue(Enum.GetValues(typeof(TierLevel)).Cast<TierLevel>().ToList()), typeof(Item), PropertyHelper<ItemColor>.GetPropertyName(() => i.Color), item);
            }
            foreach (var item in Enum.GetValues(typeof(ItemCategory)).Cast<ItemCategory>().ToList())
            {
                p.LikeNotLike.AddProperty(Chance.SelectRandomValue(Enum.GetValues(typeof(TierLevel)).Cast<TierLevel>().ToList()), typeof(Item), PropertyHelper<ItemCategory>.GetPropertyName(() => i.Category), item);
            }
        }
    }
}